home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 June / CHIP_CD_2004-06.iso / software / miranda_hit / files / mirinstsetup.exe / Miranda Installer 0.0.1.2 / devinfo.txt < prev    next >
Encoding:
Text File  |  2004-04-20  |  5.3 KB  |  140 lines

  1. Miranda Installer - Developers info
  2.   Using scripts in your own addon
  3. -----------------------------------
  4.  
  5.  
  6. For installations, Miranda Installer uses a single XML script to describe installation.
  7. The syntax is pretty straight-forward:
  8.  
  9. --------------------------------------------------------
  10. <?xml version="1.0" encoding="ISO-8859-1" ?>
  11. <installscript>
  12.  <info>
  13.   <name>Name of addon</name>
  14.   <author>Author of addon</author>
  15.   <version>Version of addon</version>
  16.   <type>[plugin | icon | sound | langpack | tool | source | doc | skin | nightly]</type> <!-- type of addon -->
  17.  </info>
  18.  
  19.  <!-- below are installation packages
  20.  the addon must have at least one package, which is the main one -->
  21.  
  22.  <!-- files that are in the zip but are not mentioned in any of the packages, will not be installed at all, so keep that in mind! -->
  23.  <packageinfo>
  24.   <optional/> <!-- optional tag, pretty much tells that the package is optional (Notice the tag is empty - i.e. No start/end pair) -->
  25.   <title>Title of package</title> <!-- This is the title of the package, can be whatever you want -->
  26.   <file>file1.dll</file> <!-- installation files. "file1.dll" means the file is in the root of the zip archive, use the relative path as well if it's in a relative path (i.e. "somefolder\test1.dll") -->
  27.   <file>file2.dll</file>
  28.  </packageinfo>
  29.  
  30.  <autorun> <!-- The autorun tag is only allowed once! i.e. One file to be executed per installation, tops :) -->
  31.   <file>somefile.txt</file>
  32.   <document/> <!-- Means the type of file is a document (Text - .txt, or HTML - .htm/.html). if this is ommitted, the user will always be asked for confirmation -->
  33.  </autorun>
  34. </installscript>
  35. --------------------------------------------------------
  36.  
  37.  
  38. A sample installation script (Used for PopUp plugin):
  39. --------------------------------------------------------
  40. <?xml version="1.0" encoding="ISO-8859-1" ?>
  41. <installscript>
  42.  <info> <!-- installation information -->
  43.   <name>PopUp</name>
  44.   <author>Hrk</author>
  45.   <version>1.0.1.7</version>
  46.   <type>Plugin</type>
  47.  </info>
  48.  
  49.  <packageinfo>
  50.   <title>Main Files</title>
  51.   <file>popup.dll</file>
  52.  </packageinfo>
  53.  
  54.  <packageinfo>
  55.   <title>Documentation and Translation</title>
  56.   <file>faq_popup.txt</file>
  57.   <file>readme_popup.txt</file>
  58.   <file>translation_popup.txt</file>
  59.   <optional/>
  60.  </packageinfo>
  61.  
  62.  <packageinfo>
  63.   <title>Developers Info</title>
  64.   <file>m_popup.h</file>
  65.   <file>m_popup_inc</file>
  66.   <optional/>
  67.  </packageinfo>
  68.  
  69.  <autorun>
  70.   <file>readme_popup.txt</file>
  71.   <document/>
  72.  </autorun>
  73. </installscript>
  74. --------------------------------------------------------
  75.  
  76. The script's DTD is at the bottom of this file.
  77. The installation script is saved as "InstallScript.xml" in the root of the zip file.
  78.  
  79. A few notes:
  80.   - The content of the <type> element is case-insensitive. i.e., <type>plugin</type> and <type>Plugin</type> are the same.
  81.   - Before you include the script with your addon, you should always try it yourself with Miranda Installer, to make sure it works.
  82.   - If Miranda Installer refuses to use the script, saying it's invalid, you should run your script through an XML validator
  83.     first, to make sure the error isn't just a silly typo :) (Try: http://www.stg.brown.edu/service/xmlvalid/).
  84.   - Comments *MUST NOT* be used where data is expected, i.e. don't do this:
  85.     <author>Me <!-- This is my name --></author>
  86.     It won't work. However, this is ok:
  87.     <info> <!-- Info about the installation -->
  88.      <name>...</name>
  89.      ...
  90.     </info>
  91.  
  92. Important Stuff:
  93.   - Files in the zip are copied as-is to their installation directory, no extra sub-directories are created.
  94.     So, to keep the mess to a minimum, if you're adding an installation script to an installation with lots of files,
  95.     You should always put the installed files in another directory in the zip, don't forget to add the changes to your script:
  96.     <packageinfo>
  97.      ...
  98.      <file>MyPlugin\main.cpp</file>
  99.      <file>MyPlugin\Info.txt</file>
  100.     </packageinfo>
  101.     That way, all of the files you specify will be installed (By default) into <Addon directory>\MyPlugin
  102.  
  103. ---------------------------------------------------
  104.  
  105. XML Script's DTD:
  106.  
  107. <!ELEMENT installscript (info,packageinfo+,autorun?)>
  108. <!ELEMENT info          (name,author,version,type)>
  109. <!ELEMENT name          (#PCDATA)>
  110. <!ELEMENT author        (#PCDATA)>
  111.  
  112. <!ELEMENT version        (#PCDATA)>
  113. <!ELEMENT type            (#PCDATA)> <!-- one of plugin|icon|sound|langpack|tool|source|doc|skin|nightly -->
  114.  
  115.  
  116.  
  117. <!ELEMENT packageinfo    (optional?,title,file+)>
  118. <!ELEMENT optional        EMPTY>
  119. <!ELEMENT title            (#PCDATA)>
  120.  
  121. <!ELEMENT file            (#PCDATA)>
  122. <!ELEMENT autorun        (file,document?)>
  123. <!ELEMENT document        EMPTY>
  124.  
  125. ---------------------------------------------------
  126.  
  127. Miranda Installer identifies addons using their script - if an addon declares itself as an Icon (<info>...<type>Icon</type></icon>),
  128. no matter what its extension is, the addon will be treated as an icon.
  129. The file extension is only checked when an installation script is missing, or is invalid in some way.
  130. Extensions for different types of installations:
  131.  
  132. *.mir - Plugin (Keeping it consistent with PluginInstaller)
  133. *.min - Nightly
  134. *.mii - Icon
  135. *.mis - Sound
  136. *.mil - Language Pack
  137. *.mit - Tool
  138. *.mio - Source
  139. *.mic - Documentation
  140. *.mik - Skin/Background Image and such